<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.1.2/echarts.min.js"></script>
</head>

<body>
  <div id="main" style="width: 600px; height:400px;"></div>

  <script type="text/javascript">
    // 初始化一个图表对象
    const chart = echarts.init(document.getElementById('main'))
    // 创建一个配置对象option
    const option = {
      // x轴
      xAxis: {
        data:  ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
      },
      // y轴
      yAxis: {
        // 显示轴线
        axisLine: {
          show: true
        },
        // 显示刻度线
        axisTick: {
          show: true
        }
      },
      // 系列
      series:  [
        {
          name: '销量',
          type: 'bar',
          data: [20, 15, 30, 16, 23, 40]
        },
        {
          name: '库存',
          type: 'line',
          data: [24, 12, 35, 18, 13, 30]
        }
      ],

      // 提示框
      tooltip: {},

      // 图例
      legend: {
        // data: ['销量']
      }
    }
    // 将配置设置给图表
    chart.setOption(option)

  </script>
</body>
</html>